import turtle
import time
turtle.speed(0)
times = 100
colors = ['green', 'blue', 'yellow', 'red']

for i in range(times):
    turtle.width(i/100*20)
    pos = turtle.pos
    heading = turtle.heading()
    # turtle.pendown()
    if i % 2 == 0:
        # turtle.fd(i)
        # turtle.lt(360/6)
        for k in range(4):
            turtle.penup()
            turtle.color(colors[k % 4])
            turtle.fd(i)
            turtle.lt(360/4)
            turtle.pendown()
            turtle.circle(i, None, 360)
    else:
        turtle.penup()
        turtle.fd(i)

        turtle.pendown()

        for k in range(40):
            turtle.color(colors[k % 4])
            turtle.fd(k*i/10)
            turtle.lt(360/4+3)
    turtle.pos = pos
    turtle.seth(heading)
    turtle.penup()
    turtle.fd(i*10)
    turtle.lt(360/6+3)

time.sleep(100)
